<?php
	class dataBase {	
		
    var $db = "opencv_db";
		var $user = "root";
		var $pass = "adcare";
		var $conection = NULL;
		var $result;

		function dataBase(){
			$conection = mysql_connect("localhost",$this->user,$this->pass);
			if (!$conection){
				echo "DIE";
			}
			else {
				if(!mysql_select_db($this->db)){
					echo "Error selecting database";
				}
			}
		}

		function closeConnection(){
			mysql_close($conection);
		}

		function getConnection(){
			return $conection;
		}

		function runQuery($query){
    	$this->result = mysql_query($query);
		}

		function fetchRow(){
			return mysql_fetch_row($this->result);
		}
	}
?>

